package JAVACORE_TRAINING.ADVANCED.SWING;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

public class DemoSwing extends JFrame implements ActionListener{
	private JTextField jTextField;
	private JButton jButton;
public DemoSwing() {
	this.setTitle("Tutorial SWING!");
	this.setSize(300, 250);
	this.setLocation(260, 250);
	this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	
	jTextField = new JTextField();
	add(jTextField,"North",0);
	
	jButton = new JButton("Button");
	add(jButton, "South", 0);
	jButton.addActionListener(this);
}
public static void main(String[] args) {
	DemoSwing demoSwing = new DemoSwing();
	demoSwing.setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
	JOptionPane.showMessageDialog(null, jTextField.getText());
	
}
}
